{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "430b8f27",
   "metadata": {},
   "outputs": [],
   "source": [
    "from chiplet import QPU\n",
    "from dag import Circuit_DAG"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3c66a078",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 电路图 bv / qaoa / qft / vqa , 50 261 360 495 630\n",
    "circuit_type = \"bv\"\n",
    "qubit_num = 50\n",
    "qasm_file = f\"circuits/{circuit_type}_{qubit_num}.qasm\"\n",
    "circuit_dag = Circuit_DAG(qasm_file)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ff3b2fff",
   "metadata": {},
   "outputs": [],
   "source": [
    "from expr_greedy import schedule_greedy\n",
    "from expr_optimal import schedule_optimal\n",
    "\n",
    "\n",
    "def callback_function(paths: list[list[int]], qpu: QPU):\n",
    "    return\n",
    "\n",
    "\n",
    "for i in range(1):\n",
    "    # chip_type - Chip指向的类型，有 \"square\", \"hexagon\", \"heavy_square\", \"heavy_hexagon\" 四种\n",
    "    qpu = QPU(chip_type=\"square\", inner_chip_size=5, inter_chip_array=[\n",
    "        2, 2], circuit_dag=circuit_dag, just_one_map=(circuit_type == \"vqa\" or circuit_type == \"qft\"))\n",
    "    qpu.draw_chiplet()\n",
    "    max_depth_greedy = schedule_greedy(qpu)\n",
    "    print(f\"max_depth_greedy：{max_depth_greedy}\")\n",
    "    max_depth_optimal = schedule_optimal(qpu)\n",
    "    print(f\"max_depth_optimal：{max_depth_optimal}\")"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "qiskit_env",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
